import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;


public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		admin kathir = new admin();
		String choice = "0";
		do {
			System.out.println("1.Add Book");
			System.out.println("2.Book Availablity");
			System.out.println("3.Remove Book");
			System.out.println("4.Exit");
			System.out.println("Enter Your Choice");
			BufferedReader br = new BufferedReader(new InputStreamReader(
					System.in));
			try {
				choice = br.readLine();
				System.out.println("You Entered choice : " + choice);
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
			try {
				if(choice.equals("1")){
					System.out.println("Enter Book Name");
					String BookName = br.readLine();
					kathir.addBookToSelf(BookName);
					int loc = kathir.addBookToSelf(BookName);
					System.out.println("Book is added in the location : "+loc);
				}else if(choice.equals("2")){
					System.out.println("Enter Book Name");
					String BookName = br.readLine();
					boolean temp = kathir.checkAvailability(BookName);
					
					if (kathir.checkAvailability(BookName)==true)
					{
						System.out.println("Book Available");
					}if (kathir.checkAvailability(BookName)==false)
					{
						System.out.println("Book Not Available");
					}
				}else if(choice.equals("3")){
					System.out.println("Enter Book Name");
					String BookName = br.readLine();
					int loc = kathir.removeBookFromSelf(BookName);
					System.out.println("Book Is Removed From the Location"+loc);
					
				}
			} catch (IOException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			
		} while (!choice.equals("4"));
		
	}

}
